  
    function getBorderRadius() {
      if (Math.random() > 0.5) {
        return "100px";
      }
      return "0px";
    }

    function getRandomColor() {
      var letters='0123456789ABCDEF'.split('');
      var color='#';
      for (var i=0; i<6; i++) {
        color=color+letters[Math.round(Math.random()*15)];
      }
      return color;
    }
  
    var clickedTime=0;
    var createdTime=0;
    var reactionTime=0;
    
    function makeBox() {
      var x=Math.random()*5000;
      setTimeout(function(){
        document.getElementById("box").style.backgroundColor=getRandomColor();
        document.getElementById("box").style.display="block";
        document.getElementById("box").style.borderRadius=getBorderRadius();
        document.getElementById("box").style.top=Math.floor(300*Math.random())+"px";
        document.getElementById("box").style.left=Math.floor(500*Math.random())+"px";
        createdTime=Date.now();
      }, x);
    }
    
    makeBox();
    
    document.getElementById("box").onclick=function(){
      clickedTime=Date.now();
      reactionTime=(clickedTime-createdTime)/1000;
      document.getElementById("time").innerHTML=reactionTime;
      this.style.display="none";
      makeBox();
    }
    